package com.jinwen.ch01;

public class Demo05{
	
	private static String usernameRef;
	private static String passwordRef;
	
	synchronized public static void doPost(String username,String password){
		try{
			usernameRef = username;
			if(username.equals("a")){
				Thread.sleep(5000);
			}
			passwordRef = password;
			System.out.println("username=" + usernameRef + " password="+password);
		}catch(InterruptedException e){
			e.printStackTrace();
		}
	}
	
	
}
